package com.xianyun.site.auth.service;

import com.xianyun.site.auth.common.token.IAuthenticationToken;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author songyinyin
 * @date 2020/5/5 上午 12:05
 */
public interface IUserDetailsService extends UserDetailsService {
    /**
     * 根据扩展Key加载用户
     * @param token Token
     * @return 用户信息
     * @throws UsernameNotFoundException  用户名为发现异常
     */
    UserDetails loadUserByExtendKey(IAuthenticationToken token) throws UsernameNotFoundException;
}
